home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: news2.interlog.com!rose!awhite
- From: awhite@user.rose.com (A White)
- Subject: Re: Referances troubble
- Sender: news@rose.com (news)
- Organization: Rose Media Incorpoarted, Ontario, Canada
- Message-ID: <Dn94Ly.FB5@rose.com>
- References: <1266.6624T117T1455@himolde.no>
- Date: Fri, 23 Feb 1996 23:15:33 GMT
-
- In article <1266.6624T117T1455@himolde.no>,
- Nameless <Espen.Berntsen@himolde.no> wrote:
- >Ok, I have aslight problem with references. The problem is that I have to pass a
- >few pointers to a subroutine, where things are done to them, and then they are
- >passed back. Now, what I hoped would work was something like this
- >
- >void Tester(void &Testering)
-
- I hope you are using C++, because this is not a C construct
-
- > void *Test;
- >
- > Tester(Test);
- >
- >// FreeMem(Test, 100);
-
- If you are using C++, then Tester should be (I'm guessing at this, but try it)
- void Tester( void& *Testering )
- because you want a reference to a pointer to void, which matches the type
- void *Test;
-
- If you are using C, try:
- void Testering( void **Testering
- {
- *Testering = AllocMem...
- and
- Tester( &Test ); within main
-
-
-
-